<!-- toaster directive -->
<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
<!-- / toaster directive -->

<!-- 导航条 -->
<div class="bg-white bread-crumb">
    <ul class="breadcrumb b-a m-b-n-xs lter b-b wrapper-md">
        <li><a ui-sref="main.tpl.homePage"><i class="fa fa-home"></i> 首页</a></li>
        <li class="active" ng-bind="title"></li>
      <!--  <a style="float: right;margin-right: 12%;margin-top: -10px;" ui-sref="main.finance.extractApply.create"
        	has-permission permission='finance.extractApply.add' class="btn btn-sm btn-info">
            <i class="icon-user-follow m-r-sm text-md"></i>申请提现</a>-->
    </ul>
</div>

<!-- 加载提醒 -->
<div ng-show="loading" class="text-center m-t-md text-lg"><i class="fa fa-spin fa-spinner"></i> 数据加载中...</div>

<!-- 内容区域 -->
<div ng-hide="loading" class="wrapper-md content">
    <!-- 数据显示 -->
    <div class="wrapper-data">
        <div class="panel panel-default">
            <!-- 头部 -->
            <div class="panel-body">
                <form ng-submit="searchRe()" class="form-horizontal">
                    <div class="form-group center">
                        <div class="col-md-2">
                            <input type="text" class="form-control" placeholder="请输入用户ID" ng-model="param.userIdS" onkeyup="if(!/^\d+$/.test(this.value)) { this.value='';}">
                        </div>
                        <div class="col-md-2">
                            <input type="text" id="applyMinDate" ng-model="param.applyMinDate" placeholder="开始申请时间" class="form-control" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                        </div>

                        <div class="col-md-2">
                            <input type="text" id="applyMaxDate" ng-model="param.applyMaxDate" placeholder="结束申请时间" class="form-control" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                        </div>
                        <div class="col-md-2">
                            <input type="text" class="form-control" placeholder="请输入银行流水号" ng-model="param.bankTradeNo">
                        </div>

                        <div class="col-md-2">
                            <select class="form-control" ng-model="param.tradeState">
                                <option value="">--交易状态--</option>
                                <option value="1">待审核</option>
                                <option value="2">审核完成</option>
                                <option value="3">审核失败</option>
                                <option value="4">取消</option>
                                <option value="5">付款完成</option>
                            </select>
                        </div>

                        <div class="col-md-2">
                            <select class="form-control" ng-model="param.receiptType">
                                <option value="">--提现方式--</option>
                                <option value="1">支付宝</option>
                                <option value="2">财付通</option>
                                <option value="3">银行转账</option>
                                <option value="4">现金</option>
                            </select>
                        </div>

                    </div>

                    <div class="form-group">
                        <div class="col-md-2">
                            <input type="text" id="tradeMinDate" ng-model="param.tradeMinDate" placeholder="开始交易时间" class="form-control" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                        </div>
                        <div class="col-md-2">
                            <input type="text" id="tradeMaxDate" ng-model="param.tradeMaxDate" placeholder="结束交易时间" class="form-control" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                        </div>
                        <div class="col-md-1">
                            <label class="col-sm-1 control-label"><button class="ifc-btn btn-primary" type="submit">查 询</button></label>
                        </div>
                        <div class="col-md-1">
                            <label class="col-sm-1 control-label"><button class="ifc-btn btn-dark" type="button" ng-click="clearSearch()">清 空</button></label>
                        </div>
                    </div>
                </form>
            </div>

            <!-- 数据表格 -->
            <div class="table-responsive">
                <table class="table table-striped b-t b-light text-center">
                    <thead>
                    <tr>
                        <th><input type="checkbox" ng-click="selectAll($event)"/>全选</th>
                        <th>编号</th>
                        <th>用户Id</th>
                        <th>流量主</th>
                        <th>账号</th>
                        <th>开户行</th>
                        <th>提现金额</th>
                        <th>交易流水号</th>
                        <th>银行流水号</th>
                        <th>申请时间</th>
                        <th>交易时间</th>
                        <th>类型</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="item in pageInfo.records">
                        <td class="v-middle"><input ng-model="subCheckBox" type="checkbox"/></td>
                        <td class="v-middle">{{item.id}}</td>
                        <td class="v-middle">{{item.userId}}</td>
                        <td class="v-middle">{{item.companyName}}</td>
                        <td class="v-middle">{{item.cardNumber}}</td>
                        <td class="v-middle">{{item.bankName}}</td>
                        <td class="v-middle">{{item.amount}}</td>
                        <td class="v-middle">{{item.flowId}}</td>
                        <td class="v-middle">{{item.orderId}}</td>
                        <td class="v-middle">{{item.applyDate | date:'yyyy-MM-dd HH:mm:ss'|limitTo:19}}</td>
                        <td class="v-middle">{{item.tradeDate | date:'yyyy-MM-dd HH:mm:ss' |limitTo:19 }}</td>
                        <td class="v-middle">
                            <span ng-if="item.source=='1'">前台</span>
                            <span ng-if="item.source=='2'">后台</span>
                        </td>
                        <td class="v-middle">
                            <span ng-if="item.rechargeStatus=='1'">待审核</span>
                            <span ng-if="item.rechargeStatus=='2'">审核完成</span>
                            <span ng-if="item.rechargeStatus=='3'">审核失败</span>
                            <span ng-if="item.rechargeStatus=='4'">取消</span>
                            <span ng-if="item.rechargeStatus=='5'">付款完成</span>
                        </td>
                        <td class="v-middle">
                            <a ui-sref="main.finance.extractApply.read({id: item.id})" class="btn btn-sm btn-default">
                                <i class="fa fa-edit m-r-xs text-sm"></i>详情</a>
                            <button type="button" ng-if="item.rechargeStatus==2" ng-click="showApply(item.id)" class="btn btn-sm btn-default m-l-xs">
                                <i class="fa fa-check m-r-xs text-sm"></i>付款</button>
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div><!-- /.table-responsive -->

            <!-- 底部分页 -->
            <span data-ng-include=" 'src/tpl/pageInfo.html' "></span>
        </div><!-- /.panel -->
    </div><!-- /.wrapper-data -->
    <form id="applyPay">
        <div class="modal fade bs-example-modal-lg" tabindex="-1" data-backdrop="static" id="fukuan" role="dialog" aria-labelledby="gridSystemModalLabel">
            <div class="modal-dialog modal-lg" role="document">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        <h4 class="modal-title" id="gridSystemModalLabel">快速付款</h4>
                    </div>
                    <div class="modal-body">
                        <div class="row">
                            <label class="col-sm-2 control-label text-right">名称:</label>
                            <label class="col-sm-4">{{extract.supplyName}}</label>

                            <label class="col-sm-2 control-label text-right">付款方式:</label>
                            <label class="col-sm-4" ng-if="extract.acctType==1">支付宝</label>
                            <label class="col-sm-4" ng-if="extract.acctType==2">财付通</label>
                            <label class="col-sm-4" ng-if="extract.acctType==3">银行转账</label>
                            <label class="col-sm-4" ng-if="extract.acctType==4">现金</label>
                        </div>
                        <div class="row">
                            <label class="col-sm-2 control-label text-right">开户行:</label>
                            <label class="col-sm-4">{{extract.bankName}}</label>

                            <label class="col-sm-2 control-label text-right">金额:</label>
                            <label class="col-sm-4">{{extract.extractAmount}}</label>
                        </div>
                        <div class="row">
                            <label class="col-sm-2 control-label text-right">账号:</label>
                            <label class="col-sm-4">{{extract.bankCardNo}}</label>

                            <label class="col-sm-2 control-label text-right">申请日期:</label>
                            <label class="col-sm-4">{{extract.applyDate | date:'yyyy-MM-dd'|limitTo:10}}</label>
                        </div>
                        <div class="row">
                            <label class="col-sm-2 control-label text-right">申请人:</label>
                            <label class="col-sm-4">{{extract.applyUserName}}</label>

                            <label class="col-sm-2 control-label text-right">外部流水号:</label>
                            <div class="col-sm-4">
                                <input type="text" class="form-control require" name="tradeNo" id="tradeNo" placeholder="外部流水号" data-title="外部流水号" ng-model="extract.tradeNo" onkeyup="if(!/^\d+$/.test(this.value)) { this.value='';}">
                            </div>
                        </div>
                        <p></p>
                        <div class="row">
                            <label class="col-sm-2 control-label text-right">打款日期:</label>
                            <div class="col-sm-4">
                                <input type="text" placeholder="打款日期" name="payDate" id="payDate" class="form-control require" data-title="打款日期" ng-model="extract.payDate" onclick="laydate({istime: true, format: 'YYYY-MM-DD', start: laydate.now(0, 'YYYY-MM-DD')})"/>
                            </div>
                        </div>

                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                        <button type="button" class="btn btn-primary"  ng-disabled="isDisabled" ng-click="saveExtractPay()">确定</button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div><!-- /.modal -->
    </form>

</div><!-- /.wrapper-md -->